package com.zito.health.controller;

import com.zito.health.common.annotations.ResponseResult;
import com.zito.health.common.result.PlatformResult;
import com.zito.health.common.result.VerifyResult;
import com.zito.health.entity.ItemResearcher;
import com.zito.health.entity.ItemText;
import com.zito.health.entity.ItemUndertake;
import com.zito.health.service.ItemTextService;
import com.zito.health.service.ItemUndertakeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目-大字段表
 */
@Slf4j
@RestController
@RequestMapping("/item/text")
public class ItemTextController {

    @Autowired
    private ItemTextService itemTextService;

    @PostMapping("/save")
    public PlatformResult save(ItemText item){
        itemTextService.save(item);
        return  PlatformResult.success();
    }

    @PostMapping("/update")
    public PlatformResult update(ItemText item){
        itemTextService.update(item);
        return  PlatformResult.success();
    }

    @PostMapping("/query")
    public PlatformResult query(ItemText item){
        return PlatformResult.success(itemTextService.queryOne(item));
    }

    @PostMapping("/list")
    public PlatformResult list(ItemText item){
        return PlatformResult.success(itemTextService.query(item));
    }

    @PostMapping("/delete")
    public PlatformResult delete(Integer id){
        itemTextService.delete(id);
        return  PlatformResult.success();
    }

}
